package org.cerberus.platform;

import static org.cerberus.platform.component.ComponentUtilities.init;

import java.util.List;

import org.cerberus.platform.component.ComponentUtilities;
import org.cerberus.platform.component.annotations.PAttribute;
import org.cerberus.platform.component.annotations.FetchType;
import org.cerberus.platform.component.annotations.PComponent;

@PComponent(classID = ClientIDs.PLATFORM_ROOT)
public class PlatformRoot {

	@PAttribute(name="components", fetch=FetchType.EAGER)
	private List<Object> components;
	
	PlatformRoot() {
		init(this, "$Root");
	}
	
	public void addComponent(Object component) {
		components.add(component);
		ComponentUtilities.attributeChanged(this, "components");
	}
	
	public void removeComponent(Object component) {
		components.remove(component);
		ComponentUtilities.attributeChanged(this, "components");
	}
	
}
